Documentation
Feedback
Guides
Learning Center

Learning Center
Learning Center
Look'n Feel
View in Portuguese
This content was migrated from the VTEX Learning Center and is no longer being actively maintained. For the most accurate and up-to-date information, please check the official documentation.

Introduction

The Admin Framework exists to unify channels and make life easier for the store operator. It is important, however, that the visual experience is homogeneous to avoid inconsistency of usability.

In order to facilitate visual integration for the developer, Styleguide is available and with several components that can be used to quickly create administrative screens.

Activity

  1. In step 1, in the /react/adminExample.tsx file we add vtex.styleguide as a dependency, import the styleguide'sLayout and PageBlock so that we can use them:

_10
import { Layout, PageBlock } from 'vtex.styleguide'

  1. Both components are responsible for creating the admin layout that is used by VTEX apps, you can compose them as follows:

_14
import React, { FC } from 'react'
_14
import { Layout, PageBlock } from 'vtex.styleguide'
_14
_14
const AdminExample: FC = () => {
_14
return (
_14
<Layout>
_14
<PageBlock variation="full">
_14
<h1>Hello, World!</h1>
_14
</PageBlock>
_14
</Layout>
_14
)
_14
}
_14
_14
export default AdminExample

  1. By viewing the [PageBlock] documentation (https://styleguide.vtex.com/#/Components/Admin%20structure/PageBlock), we can enrich it by adding a title and description:

_18
import React, { FC } from "react";
_18
import { Layout, PageBlock } from "vtex.styleguide";
_18
_18
const AdminExample: FC = () => {
_18
return (
_18
<Layout>
_18
<PageBlock
_18
+ title="Titulo"
_18
+ subtitle="Alguma explicação."
_18
+ variation="full"
_18
>
_18
<h1>Hello, World!</h1>
_18
</PageBlock>
_18
</Layout>
_18
);
_18
};
_18
_18
export default AdminExample;

The expected result should be:

{"base64":"  ","img":{"width":1019,"height":280,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":14394,"url":"https://user-images.githubusercontent.com/18701182/92802313-cc7df800-f38c-11ea-95a1-035948dbbc85.png"}}

Answer sheet

See answer sheet for adminExample.tsx
adminExample.tsx

_14
import React, { FC } from 'react'
_14
import { Layout, PageBlock } from 'vtex.styleguide'
_14
_14
const AdminExample: FC = () => {
_14
return (
_14
<Layout>
_14
<PageBlock title="Titulo" subtitle="Alguma explicação." variation="full">
_14
<h1>Hello, World!</h1>
_14
</PageBlock>
_14
</Layout>
_14
)
_14
}
_14
_14
export default AdminExample

On this page