Skip to content

Feature grid ​

A section heading with a responsive grid of features, each with an icon, a title and a short description.

Installation ​

bash
npx bootcn add feature-grid
bash
pnpm dlx bootcn add feature-grid
bash
yarn dlx bootcn add feature-grid
bash
bunx --bun bootcn add feature-grid

The CLI also installs the design tokens and these blocks and components: none. It prints the <link> and <script> tags to add to your layout.

Usage ​

Add or remove <li> items; the grid fits as many columns as the width allows (about 17rem each). Swap the inline SVG icons for your own; keep aria-hidden="true" on them.

Accessibility ​

  • The features are a list, so screen readers announce how many there are.
  • The section is named by its <h2>; each feature has an <h3>.
  • Icons are decorative; the titles carry the meaning.

Dependencies ​

  • Bootstrap 5.3+ CSS.
  • themes/tokens/tokens.css.

Source ​

The exact files the CLI installs (feature-grid@1.0.0). View on GitHub · Report an issue

html
<section class="bootcn-features" aria-labelledby="bootcn-features-title">
  <div class="bootcn-features__header">
    <p class="bootcn-features__eyebrow">Features</p>
    <h2 class="bootcn-features__title" id="bootcn-features-title">Everything you need to launch</h2>
    <p class="bootcn-features__lead">
      Build pages people enjoy using, without fighting your tools.
    </p>
  </div>
  <ul class="bootcn-features__grid">
    <li class="bootcn-features__item">
      <span class="bootcn-features__icon"
        ><svg
          class="bootcn-icon"
          width="16"
          height="16"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
          focusable="false"
        >
          <path d="M13 2 3 14h9l-1 8 10-12h-9z" /></svg
      ></span>
      <h3 class="bootcn-features__name">Fast by default</h3>
      <p class="bootcn-features__text">
        Static HTML and a few kilobytes of CSS. Pages load before anyone notices.
      </p>
    </li>
    <li class="bootcn-features__item">
      <span class="bootcn-features__icon"
        ><svg
          class="bootcn-icon"
          width="16"
          height="16"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
          focusable="false"
        >
          <circle cx="12" cy="12" r="9" />
          <path d="m8 12 3 3 5-6" /></svg
      ></span>
      <h3 class="bootcn-features__name">Accessible</h3>
      <p class="bootcn-features__text">
        Keyboard support, labels and contrast are part of every component, in both themes.
      </p>
    </li>
    <li class="bootcn-features__item">
      <span class="bootcn-features__icon"
        ><svg
          class="bootcn-icon"
          width="16"
          height="16"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
          focusable="false"
        >
          <path d="M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z" /></svg
      ></span>
      <h3 class="bootcn-features__name">Dark mode built in</h3>
      <p class="bootcn-features__text">
        Every color is a token with a light and a dark value. Switch with one attribute.
      </p>
    </li>
    <li class="bootcn-features__item">
      <span class="bootcn-features__icon"
        ><svg
          class="bootcn-icon"
          width="16"
          height="16"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
          focusable="false"
        >
          <path d="m16 18 6-6-6-6" />
          <path d="m8 6-6 6 6 6" /></svg
      ></span>
      <h3 class="bootcn-features__name">Code you own</h3>
      <p class="bootcn-features__text">
        Copy the files into your project and change anything. No package to update.
      </p>
    </li>
    <li class="bootcn-features__item">
      <span class="bootcn-features__icon"
        ><svg
          class="bootcn-icon"
          width="16"
          height="16"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
          focusable="false"
        >
          <rect x="3" y="4" width="18" height="16" rx="2" />
          <path d="M3 10h18M9 10v10" /></svg
      ></span>
      <h3 class="bootcn-features__name">Responsive layouts</h3>
      <p class="bootcn-features__text">
        Grids and navigation adapt from phones to wide screens without extra work.
      </p>
    </li>
    <li class="bootcn-features__item">
      <span class="bootcn-features__icon"
        ><svg
          class="bootcn-icon"
          width="16"
          height="16"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
          focusable="false"
        >
          <path d="M12 3 4 6v6c0 5 3.5 8 8 9 4.5-1 8-4 8-9V6z" /></svg
      ></span>
      <h3 class="bootcn-features__name">No runtime surprises</h3>
      <p class="bootcn-features__text">
        No framework and no build step in production, so nothing breaks on upgrade.
      </p>
    </li>
  </ul>
</section>
css
.bootcn-features__header {
  max-width: 40rem;
  margin: 0 auto 3rem;
  text-align: center;
}

.bootcn-features__eyebrow {
  margin: 0 0 0.5rem;
  color: var(--bootcn-muted-foreground);
  font-size: 0.875rem;
  font-weight: 600;
}

.bootcn-features__title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .bootcn-features__title {
    font-size: 2.25rem;
  }
}

.bootcn-features__lead {
  margin: 1rem 0 0;
  color: var(--bootcn-muted-foreground);
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.bootcn-features {
  padding: 4rem 0;
}

/* One column on phones, two on tablets, three on wide screens. */
.bootcn-features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 2rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bootcn-features__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  border: var(--bootcn-border-width) solid var(--bootcn-border-color);
  border-radius: var(--bootcn-radius-lg);
  background-color: var(--bootcn-background);
  color: var(--bootcn-foreground);
  box-shadow: var(--bootcn-shadow-sm);
}

.bootcn-features__icon .bootcn-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.bootcn-features__name {
  margin: 0 0 0.375rem;
  font-size: 1rem;
  font-weight: 600;
}

.bootcn-features__text {
  margin: 0;
  color: var(--bootcn-muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5rem;
}

Released under the MIT License. Not affiliated with Bootstrap or shadcn/ui.