Bedrock
We use Bedrock as our library of choice when it comes to layouting:
Components vs. Layout
Components are distinct units of interface, that shouldn't make any assumptions about where they're used. They should just use all the place given to them.
This makes it necessary to add dedicated layout functionality to your Design System, to help users actually create pages and interfaces out of your offered components!
We offer the Section
for this when constructing websites, because it has some really nice convenience features for that! When more flexibility is needed we like to add Bedrock into the mix, which is easily connected to your Design Token set (for example your existing spacings) for a cohesive overall experience.
Integrating with kickstartDS
The kickstartDS spacing Token are mapped to the internal Bedrock scale in the BedrockProvider.jsx
file.
Tips & Tricks
With the switchAt
property, precisely responsive layouts can be created.
The witdh at which a layout will switch from a row to a column display can be set.
Its supported in the Columns
, Inline
and Split
Components.
Examples
A couple common use cases:
Split
Elements can be placed next to each other with varying widths.
Toggle Code
_10import { Split } from '@bedrock-layout/primitives';_10_10<Section>_10 <Split gutter="sm" fraction="3/4">_10 <TextField hideLabel placeholder="Enter your email" />_10 <Button label="Subscribe" />_10 </Split>_10</Section>
Stack
A simple way to stack elements on top of each other.
Toggle Code
_22import { Stack } from '@bedrock-layout/primitives';_22_22<Section width="narrow">_22 <Stack gutter="sm">_22 <TeaserRow_22 topic="Generators"_22 image="https://www.kickstartds.com/img/recipes/generator.svg"_22 text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."_22 link={{_22 label: 'Explore generators',_22 }}_22 />_22 <TeaserRow_22 topic="Components"_22 image="https://www.kickstartds.com/img/recipes/toolbox.svg"_22 text="Tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod."_22 link={{_22 label: 'See our components',_22 }}_22 />_22 </Stack>_22</Section>
Columns
For a precise column layout. Elements can be streteched over multiple columns.
Toggle Code
_10import { Columns, Column } from '@bedrock-layout/primitives';_10_10<Columns switchAt={528} gutter="md" columns={4}>_10 <Logo/>_10 <Column span={2}>_10 <Nav/>_10 </Column>_10 <Button label="Login" variant="outline" size="small"/>_10</Columns>