|
| 1 | +import { DxcFlex, DxcParagraph } from "@dxc-technology/halstack-react"; |
| 2 | +import DocFooter from "@/common/DocFooter"; |
| 3 | +import QuickNavContainer from "@/common/QuickNavContainer"; |
| 4 | +import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; |
| 5 | +import Code from "@/common/Code"; |
| 6 | + |
| 7 | +const sections = [ |
| 8 | + { |
| 9 | + title: "Usage", |
| 10 | + content: ( |
| 11 | + <> |
| 12 | + <DxcParagraph> |
| 13 | + The Grid component allows for both row and column layouts while |
| 14 | + allowing for a lot of flexibility of item placement within the grid |
| 15 | + itself. |
| 16 | + </DxcParagraph> |
| 17 | + </> |
| 18 | + ), |
| 19 | + }, |
| 20 | + { |
| 21 | + title: "Layout, Spacing, and Placement", |
| 22 | + content: ( |
| 23 | + <> |
| 24 | + <DxcParagraph> |
| 25 | + The layout type can be specified using the <Code>grid-auto-flow</Code>{" "} |
| 26 | + property. This property lets you control how the auto-placement |
| 27 | + algorithm works, determining exactly how auto-placed items get flowed |
| 28 | + into the grid. Use the <Code>gap</Code> property to set the space |
| 29 | + between items and the placement properties <Code>placeContent</Code>{" "} |
| 30 | + and <Code>placeItems</Code> for more specific controls of how |
| 31 | + individual items stack or align within the grid. |
| 32 | + </DxcParagraph> |
| 33 | + </> |
| 34 | + ), |
| 35 | + }, |
| 36 | + { |
| 37 | + title: "Grid Templates", |
| 38 | + content: ( |
| 39 | + <> |
| 40 | + <DxcParagraph> |
| 41 | + You can use templates to define grid areas, columns, and rows. The{" "} |
| 42 | + <Code>grid-template-areas</Code> property is used to establish cells |
| 43 | + within a grid and assign them names.{" "} |
| 44 | + <Code>grid-template-columns</Code> defines the line names and track |
| 45 | + sizing functions of the grid columns while{" "} |
| 46 | + <Code>grid-template-rows</Code> defines the line names and track |
| 47 | + sizing functions of the grid columns. |
| 48 | + </DxcParagraph> |
| 49 | + </> |
| 50 | + ), |
| 51 | + }, |
| 52 | + { |
| 53 | + title: "Grid Items", |
| 54 | + content: ( |
| 55 | + <> |
| 56 | + <DxcParagraph> |
| 57 | + The Grid items are direct descendants of a grid container. They are |
| 58 | + represented by the <Code>DxcGrid.Item</Code> tag and should be used |
| 59 | + when the decision to follow the Grid layout pattern is assumed only by |
| 60 | + the parent container. |
| 61 | + </DxcParagraph> |
| 62 | + <DxcParagraph> |
| 63 | + In case you are building a complex Grid layout with several nested |
| 64 | + grid containers, <Code>DxcGrid.Item</Code> becomes very limited and |
| 65 | + therefore, you will have to wrap the children with{" "} |
| 66 | + <Code>DxcGrid</Code>. |
| 67 | + </DxcParagraph> |
| 68 | + </> |
| 69 | + ), |
| 70 | + }, |
| 71 | +]; |
| 72 | + |
| 73 | +const GridUsagePage = () => { |
| 74 | + return ( |
| 75 | + <DxcFlex direction="column" gap="4rem"> |
| 76 | + <QuickNavContainerLayout> |
| 77 | + <QuickNavContainer |
| 78 | + sections={sections} |
| 79 | + startHeadingLevel={2} |
| 80 | + ></QuickNavContainer> |
| 81 | + </QuickNavContainerLayout> |
| 82 | + <DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/website/screens/components/grid/usage/GridUsagePage.tsx" /> |
| 83 | + </DxcFlex> |
| 84 | + ); |
| 85 | +}; |
| 86 | + |
| 87 | +export default GridUsagePage; |
0 commit comments