FeatureGrid
Feature and FeatureGrid are landing-page pattern components for value propositions, product capabilities, and benefits sections.
Quick Start
from faststrap import Feature, FeatureGrid
FeatureGrid(
Feature(
"FastHTML native",
"Build Bootstrap interfaces directly from Python.",
icon="lightning-charge",
),
Feature(
"HTMX ready",
"Use hx_* attributes without custom JavaScript.",
icon="arrow-repeat",
),
Feature(
"Themeable",
"Stay aligned with Bootstrap and Faststrap themes.",
icon="palette",
),
columns=3,
)
Parameters
Feature
| Parameter | Type | Default | Description |
|---|---|---|---|
title |
str |
required | Feature title. |
description |
str |
required | Supporting feature copy. |
icon |
str \| Any \| None |
None |
Bootstrap icon name or custom element. |
icon_cls |
str |
"bg-primary text-white" |
Classes for the icon wrapper. |
icon_wrapper_cls |
str \| None |
None |
Extra icon wrapper classes. |
title_cls |
str |
"fs-4 fw-bold" |
Title classes. |
description_cls |
str |
"text-muted" |
Description classes. |
icon_wrapper_attrs |
dict \| None |
None |
Extra icon wrapper attributes. |
title_attrs |
dict \| None |
None |
Extra title attributes. |
description_attrs |
dict \| None |
None |
Extra description attributes. |
**kwargs |
Any |
Extra root attributes. |
FeatureGrid
| Parameter | Type | Default | Description |
|---|---|---|---|
*features |
Any |
Feature elements. | |
columns |
int |
3 |
Number of columns at the medium breakpoint. |
row_cls |
str \| None |
None |
Extra row classes. |
col_cls |
str \| None |
None |
Extra column classes. |
row_attrs |
dict \| None |
None |
Extra row attributes. |
col_attrs |
dict \| None |
None |
Extra column attributes. |
**kwargs |
Any |
Extra root attributes. |
API Reference
faststrap.components.patterns.feature.Feature(title, description, icon=None, icon_cls='bg-primary text-white', icon_wrapper_cls=None, title_cls='fs-4 fw-bold', description_cls='text-muted', icon_wrapper_attrs=None, title_attrs=None, description_attrs=None, **kwargs)
A single feature item with icon, title, and description.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Feature title |
required |
description
|
str
|
Feature description |
required |
icon
|
str | Any | None
|
Bootstrap icon name or custom element |
None
|
icon_cls
|
str
|
CSS classes for icon container |
'bg-primary text-white'
|
icon_wrapper_cls
|
str | None
|
Additional classes for the icon wrapper |
None
|
title_cls
|
str
|
Additional classes for the title element |
'fs-4 fw-bold'
|
description_cls
|
str
|
Additional classes for the description element |
'text-muted'
|
icon_wrapper_attrs
|
dict[str, Any] | None
|
Extra attributes for the icon wrapper |
None
|
title_attrs
|
dict[str, Any] | None
|
Extra attributes for the title element |
None
|
description_attrs
|
dict[str, Any] | None
|
Extra attributes for the description element |
None
|
**kwargs
|
Any
|
Additional attributes |
{}
|
Returns:
| Type | Description |
|---|---|
Div
|
Div with feature content |
Note
Marked as @beta - API may change in future releases.
Source code in src/faststrap/components/patterns/feature.py
faststrap.components.patterns.feature.FeatureGrid(*features, columns=3, row_cls=None, col_cls=None, row_attrs=None, col_attrs=None, **kwargs)
Grid layout for multiple feature items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*features
|
Any
|
Feature components |
()
|
columns
|
int
|
Number of columns (default: 3) |
3
|
row_cls
|
str | None
|
Additional classes for the row wrapper |
None
|
col_cls
|
str | None
|
Additional classes for each column wrapper |
None
|
row_attrs
|
dict[str, Any] | None
|
Extra attributes for the row wrapper |
None
|
col_attrs
|
dict[str, Any] | None
|
Extra attributes for each column wrapper |
None
|
**kwargs
|
Any
|
Additional attributes |
{}
|
Returns:
| Type | Description |
|---|---|
Div
|
Div with responsive feature grid |
Note
Marked as @beta - API may change in future releases.