Playground

Feature grid block

A section title above a responsive grid of short features.

  • 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

PropTypeDefaultDescription
title requiredReactNode–Section heading shown above the grid.
descriptionReactNode–Optional muted line under the section heading.
features requiredFeature[]–The items to show, each with a `title`, `description` and optional `icon`.
columns2 | 3 | 43Number of columns on wide screens: 2, 3 (default) or 4. Fewer columns are used on narrow screens.
headingLevel1 | 2 | 3 | 4 | 52Outline 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.

AttributeStylesheet
[data-columns="3"]block-feature-grid.css
[data-columns="4"]block-feature-grid.css

CSS classes

ClassStylesheet
.containercontainer.css
.container-fullcontainer.css
.container-pagecontainer.css
.container-textcontainer.css
.headingheading.css
.heading-displayheading.css
.heading-lgheading.css
.heading-mdheading.css
.heading-smheading.css
.heading-xlheading.css
.texttext.css
.text-accenttext.css
.text-dangertext.css
.text-fulltext.css
.text-lgtext.css
.text-mdtext.css
.text-mutedtext.css
.text-oktext.css
.text-smtext.css
.text-successtext.css
.text-truncatetext.css
.text-warningtext.css
.text-xstext.css
.block-featureblock-feature-grid.css
.block-feature-iconblock-feature-grid.css
.block-featuresblock-feature-grid.css
.block-features-gridblock-feature-grid.css
.block-features-headblock-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.