Grid row3.0
The anchor-grid-row is a non-visual component that serves as a flexible grid row for layout purposes. It's designed to be responsive.
Installation
npm i @tryg/vue-ui-libraryUsage
Install the component library as a Vue plugin. This globally registers all Anchor components.
import { createApp } from 'vue';
import { ComponentLibrary } from '@tryg/vue-ui-library';
import App from './App.vue';
const app = createApp(App);
app.use(ComponentLibrary);
app.mount('#app');<template>
<anchor-grid-row>
<anchor-grid-column column="4">Column 1</anchor-grid-column>
<anchor-grid-column column="8">Column 2</anchor-grid-column>
</anchor-grid-row>
</template>Import only the components you need for optimal bundle size.
<script setup>
import { AnchorGridRow, AnchorGridColumn } from '@tryg/vue-ui-library';
</script>
<template>
<anchor-grid-row>
<anchor-grid-column column="4">Column 1</anchor-grid-column>
<anchor-grid-column column="8">Column 2</anchor-grid-column>
</anchor-grid-row>
</template>Grid Columns
Control the number of columns in the grid using the --grid-row-columns-* CSS custom properties. Each breakpoint (xs, sm, md, lg, xl) has its own variable, allowing you to define a different column count per viewport size:
anchor-grid-row {
--grid-row-columns-xs: 4;
--grid-row-columns-sm: 6;
--grid-row-columns-md: 8;
--grid-row-columns-lg: 12;
--grid-row-columns-xl: 12;
}Grid Gutter
The gutter defines the vertical space between rows. Adjust it per breakpoint using --grid-row-gutter-*:
anchor-grid-row {
--grid-row-gutter-xs: 8px;
--grid-row-gutter-sm: 12px;
--grid-row-gutter-md: 16px;
--grid-row-gutter-lg: 24px;
--grid-row-gutter-xl: 32px;
}Horizontal Gap
The horizontal gap controls the space between columns within a row. Set it per breakpoint using --grid-row-horizontal-gap-*:
anchor-grid-row {
--grid-row-horizontal-gap-xs: 8px;
--grid-row-horizontal-gap-sm: 12px;
--grid-row-horizontal-gap-md: 16px;
--grid-row-horizontal-gap-lg: 24px;
--grid-row-horizontal-gap-xl: 32px;
}CSS variables
The Grid Row component exposes the following CSS custom properties for configuring grid layout behavior:
| Name | Description |
|---|---|
--grid-row-columns-xs | Set the number of columns in the grid at the smallest screen size. |
--grid-row-columns-sm | Set the number of columns in the grid at the small screen size. |
--grid-row-columns-md | Set the number of columns in the grid at the medium screen size. |
--grid-row-columns-lg | Set the number of columns in the grid at the large screen size. |
--grid-row-columns-xl | Set the number of columns in the grid at the extra large screen size. |
--grid-row-gutter-xs | Set the space between rows in the grid at the smallest screen size. |
--grid-row-gutter-sm | Set the space between rows in the grid at the small screen size. |
--grid-row-gutter-md | Set the space between rows in the grid at the medium screen size. |
--grid-row-gutter-lg | Set the space between rows in the grid at the large screen size. |
--grid-row-gutter-xl | Set the space between rows in the grid at the extra large screen size. |
--grid-row-horizontal-gap-xs | Set the space between columns in the grid at the smallest screen size. |
--grid-row-horizontal-gap-sm | Set the space between columns in the grid at the small screen size. |
--grid-row-horizontal-gap-md | Set the space between columns in the grid at the medium screen size. |
--grid-row-horizontal-gap-lg | Set the space between columns in the grid at the large screen size. |
--grid-row-horizontal-gap-xl | Set the space between columns in the grid at the extra large screen size. |
Accessibility
The Grid Row component is a non-visual layout element. It does not add any ARIA roles, states, or semantic meaning to its content. It serves purely as a structural container for organizing child grid columns into a responsive row layout.
API
anchor-grid-row
CSS Custom Properties
| Name | Description |
|---|---|
--grid-row-columns-lg | Set the number of columns in the grid at the large screen size. |
--grid-row-columns-md | Set the number of columns in the grid at the medium screen size. |
--grid-row-columns-sm | Set the number of columns in the grid at the small screen size. |
--grid-row-columns-xl | Set the number of columns in the grid at the extra large screen size. |
--grid-row-columns-xs | Set the number of columns in the grid at the smallest screen size. |
--grid-row-gutter-lg | Set the space between rows in the grid at the large screen size. |
--grid-row-gutter-md | Set the space between rows in the grid at the medium screen size. |
--grid-row-gutter-sm | Set the space between rows in the grid at the small screen size. |
--grid-row-gutter-xl | Set the space between rows in the grid at the extra large screen size. |
--grid-row-gutter-xs | Set the space between rows in the grid at the smallest screen size. |
--grid-row-horizontal-gap-lg | Set the space between columns in the grid at the large screen size. |
--grid-row-horizontal-gap-md | Set the space between columns in the grid at the medium screen size. |
--grid-row-horizontal-gap-sm | Set the space between columns in the grid at the small screen size. |
--grid-row-horizontal-gap-xl | Set the space between columns in the grid at the extra large screen size. |
--grid-row-horizontal-gap-xs | Set the space between columns in the grid at the smallest screen size. |
Built with StencilJS
| Anchor version | Status | Notes |
|---|---|---|
| 3.0 | Ready for Implementation | This component is in sync with Figma. |
Container
The anchor-container is a component that serves as a generic container for other components or content. It's designed to be flexible and reusable across different parts of an application.
Grid column
The grid-column component is a non-visual layout component that can be used to create a grid layout. It works as a child component of the grid-row component.
