Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
<rds-grid>
works together with the <rds-grid-item>
component. For simplicity, the documentation for both components is represented on this page.<rds-grid-item>
component has no practical applicability without <rds-grid>
, they are dependent components.<rds-grid-item>
API, visit the component page if you want to get the full list of props.The cols
prop abstracts the grid-template-columns
property allowing you to define
the configuration of grid layout columns directly in the component. are accepted
any valid value for grid-template-columns in CSS, passed as a String.
If no value is provided for the cols prop, the default value will be "1fr",
which means that the grid will have a single column that occupies all the available space
proportionally.
The cols prop accepts the following value types:
grid-template-columns
can be provided as a string.The col-span
prop abstracts the grid-column
property and allows you to indicate how many columns
of the grid the <rds-grid-item>
component (and its children) will occupy.
If the col-start property is not set, specify a col-span of, for example, 3. will be equivalent to setting grid-column: auto/span 3, making the item span three columns starting from the default (automatic) position in the grid.
The col-span prop accepts Numbers and Strings If the col-start property is not set, assign a col-span of, for example, 3, will be equivalent to setting grid-column: auto / span 3, making the item occupy three columns starting from the default (automatic) position on the grid.
The col-start prop abstracts the grid-column-start CSS property and allows you to define which column
rendering of the <rds-grid-item>
component (and its child elements) will begin.
If col-start is not defined, its default value is "auto", allowing the browser to decide the initial position of the item in the grid.
The col-start prop accepts Numbers and Strings
If the col-span property is not set, specify a col-span of, for example, 3.
will be equivalent to setting grid-column: 3 / span 1
, making the item occupy a column
starting in third position on the Grid.
The rows prop abstracts the grid-template-rows
property, allowing you to define the row configuration
of the grid layout directly in the component. Any valid value for grid-template-rows is accepted
in CSS, passed as a String. If no value is provided for the rows prop,
the default value will be "auto", which means each line will have an automatic height,
content-based.
If grid-template-rows
is not defined, its default value is 1fr
.
The cols prop accepts the following value types:
The auto-rows prop abstracts the grid-auto-rows CSS property and allows you to define the height of the rows automatically created by the grid layout. For example, if the rows property content is set to "50px 50px" and auto-rows is set to "120px" the two lines of the grid will be 50px tall, while any line additional will be 120px.
If auto-rows
is not defined, its default value is "1fr",
The cols prop accepts the following value types:
grid-auto-rows
can be provided as a string. Examples: "100px 200px auto", "repeat(3, 1fr)", "minmax(100px, auto)";Equivalent to col-span
, but for rows, the row-span
prop abstracts the grid-row
CSS property
allowing you to indicate how many lines of the grid the <rds-grid-item>
component (and its children) will occupy.
If the row-start property is not set, specify a row-span of, for example, 3. will be equivalent to setting grid-row: auto/span 3, making the item occupy three lines starting from the default (automatic) position on the grid.
The cols prop accepts the following value types:
grid-auto-rows
can be provided as a string. Examples: "100px 200px auto", "repeat(3, 1fr)", "minmax(100px, auto)";The row-start prop abstracts the grid-row-start CSS property and allows you to define which row
rendering of the <rds-grid-item>
component (and its child elements) will begin.
If row-start is not defined, its default value is "auto", allowing the browser to decide the initial position of the item in the grid.
The row-start prop accepts Numbers and Strings
If the row-span property is not set, specify a row-span of, for example, 3.
will be equivalent to setting grid-row: 3 / span 1
, making the item occupy a space
on the third line of the Grid.
The spacing between <rds-grid>
elements can be defined using the gap
props.
The number or expression passed to the prop determines a homogeneous spacing on the grid, with the same value
applied both horizontally and vertically.
The property's default value is 0, a value that leaves all elements together, without horizontal or vertical spacing.
Prop gap accepts the following value types:
gap
can be provided as a string. Examples: "100px", "4%", "5rem"; ⚠️ Important: if no unit is provided, the string entered will behave like a number and will have its value multiplied by 4, with the addition of the "px" unit. Ex.: for gap="3"
the spacing adopted will be "12px".:gap="2"
the spacing adopted will be "8px".If you need to specify a horizontal spacing different from the vertical, or indicate only one of them,
It is possible to use the row-gap
and col-gap
props.
row-gap
modifies the spacing between grid lines, while col-gap
modifies the spacing between columns.
The default value of both properties is 0, a value that leaves all elements together, without horizontal or vertical spacing.
Just like the gap
prop, row-gap
and col-gap
accept Numbers and Strings and work in the same way:
row-gap="3"
the spacing between lines will be "12px". The same goes for col-gap
;:col-gap="2"
the spacing between columns will be "8px". The same goes for row-gap
;The justify prop controls the horizontal alignment of items within the <rds-grid>
, abstracting the
justify-content property of the CSS Grid.
The default value of the property is "stretch", which causes the items within the grid to occupy the entire area. width available in the container.
Any valid CSS value that controls horizontal alignment in the grid can be provided as a
string to customize the layout as needed, such as space-between
, start
, center
and end
.
The align prop controls the vertical alignment of items within the <rds-grid>
, abstracting the property
CSS Grid align-items
.
The default value of the property is "stretch", which causes the items within the grid to occupy the entire area. height available in the container.
Any valid CSS value that controls vertical alignment in the grid can be provided as a
string to customize the layout as needed, such as start
, center
and end
.
The justify prop in <rds-grid-item>
controls the individual horizontal alignment of an item within
a grid cell, abstracting the justify-self
CSS property.
The default value of the property is "auto", which causes the item to follow the alignment behavior
set by the container's justify-content
unless a different value is specified.
By setting the justify prop on a <rds-grid-item>
, the alignment of the individual item is adjusted accordingly.
the provided value, overriding the horizontal alignment defined by the container's justify-content
.
This allows the item to have alignment behavior independent of other items in the grid.
Any valid CSS value for justify-self
can be used to customize the alignment
horizontal view of individual items within the grid, such as the start
, center
, end
and stretch
values.
The align
prop in <rds-grid-item>
controls the individual vertical alignment of an item within a grid.
grid cell, abstracting the align-self
CSS property.
The default value of the property is "auto", which causes the item to follow the alignment behavior
set by the container's align-items
unless a different value is specified.
When setting the align prop on a <rds-grid-item>
, the alignment of the individual item is adjusted according to the
value provided, overriding the vertical alignment defined by the container's align-items
.
This allows the item to have vertical alignment behavior independent of other items in the grid.
Any valid CSS value for align-self
can be used to customize the alignment
vertical view of individual items within the grid, such as the start
, center
, end
and stretch
values.
The subgrid
prop in <rds-grid-item>
allows you to transform an item into a grid, enabling the construction
of more complex layouts, with nested grids.
The default value of the property is false
, which means that <rds-grid-item>
behaves like an item
normal within a grid, without defining a new internal grid.
When the subgrid
prop is set to true
, the CSS display is changed to grid
, allowing the
item contains its own grid items.
The subgrid prop is a Boolean property that accepts the following values:
When a <rds-grid-item>
is behaving as a subgrid, it is possible to control the default organization
of elements with the direction
prop. This prop implements the grid-auto-flow
CSS property.
The default value of the property is "row", which causes the items within the subgrid to be organized in lines.
The direction prop accepts the following values:
The tag
prop allows you to define the tag that the component renders. This property is used to allow the component
be used in different contexts, such as in a footer
or a header
.
The default value of the property is div
, which means that the component renders a div.
The prop tag is a string property that accepts the following values: