Feature grid block
A section title above a responsive grid of short features.
SourceStyles source@monoline/react 0.4.0Markdown for AI toolsbeta
- Built on native elements
- A section named by its title; features are a list of items.
- Feature titles are headings one level below the section title, so the outline stays in order.
- Styles in one file:
container.css
Import
import '@monoline/css';
import {BlockFeatureGrid} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add block-feature-grid
Usage
import {BlockFeatureGrid} from '@monoline/react';
const dot = <svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor"><rect x="3" y="3" width="14" height="14" /></svg>;
const features = [
{title: 'Plain CSS', description: 'Works with any framework, or none.', icon: dot},
{title: 'Accessible', description: 'Keyboard and screen reader behaviour is tested.', icon: dot},
{title: 'Three themes', description: 'Warm, dark and midnight, one accent.', icon: dot},
{title: 'Copy and own', description: 'Every component is one small folder.', icon: dot},
{title: 'Typed', description: 'Props are string unions with sane defaults.', icon: dot},
{title: 'No runtime styling', description: 'Tokens and classes only.', icon: dot},
];
<BlockFeatureGrid
title="Why Monoline"
description="Fewer parts, clearer pages."
features={features}
/>
Examples
Three columns
Two columns
Props
BlockFeatureGridProps
| Prop | Type | Default | Description |
|---|---|---|---|
title required | ReactNode | – | Section heading shown above the grid. |
description | ReactNode | – | Optional muted line under the section heading. |
features required | Feature[] | – | The items to show, each with a `title`, `description` and optional `icon`. |
columns | 2 | 3 | 4 | 3 | Number of columns on wide screens: 2, 3 (default) or 4. Fewer columns are used on narrow screens. |
headingLevel | 1 | 2 | 3 | 4 | 5 | 2 | Outline level of the section title; each feature title is one level lower. |
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
| Attribute | Stylesheet |
|---|---|
[data-columns="3"] | block-feature-grid.css |
[data-columns="4"] | block-feature-grid.css |
CSS classes
| Class | Stylesheet |
|---|---|
.container | container.css |
.container-full | container.css |
.container-page | container.css |
.container-text | container.css |
.heading | heading.css |
.heading-display | heading.css |
.heading-lg | heading.css |
.heading-md | heading.css |
.heading-sm | heading.css |
.heading-xl | heading.css |
.text | text.css |
.text-accent | text.css |
.text-danger | text.css |
.text-full | text.css |
.text-lg | text.css |
.text-md | text.css |
.text-muted | text.css |
.text-ok | text.css |
.text-sm | text.css |
.text-success | text.css |
.text-truncate | text.css |
.text-warning | text.css |
.text-xs | text.css |
.block-feature | block-feature-grid.css |
.block-feature-icon | block-feature-grid.css |
.block-features | block-feature-grid.css |
.block-features-grid | block-feature-grid.css |
.block-features-head | block-feature-grid.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.container {
border-color: var(--accent);
}
.container[data-columns="3"] {
background: var(--wash);
}
Accessibility
- A section named by its title; features are a list of items.
- Feature titles are headings one level below the section title, so the outline stays in order.