No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:

  1. Missing Context/Providers: You can use decorators to supply specific contexts or providers, which are sometimes necessary for components to render correctly. For detailed instructions on using decorators, please visit the Decorators documentation.
  2. Misconfigured Webpack or Vite: Verify that Storybook picks up all necessary settings for loaders, plugins, and other relevant parameters. You can find step-by-step guides for configuring Webpack or Vite with Storybook.
  3. Missing Environment Variables: Your Storybook may require specific environment variables to function as intended. You can set up custom environment variables as outlined in the Environment Variables documentation.

InlineCluster

The InlineCluster component is used to display a group of elements in a row. When the group is too large to fit in a single row, the elements will be displayed in a cluster based on the width of the container and the justification of the cluster.

Installation and Import

First, you must install @bedrock-layout/css.

yarn add @bedrock-layout/css

Then, you can import the entire CSS or just the component's CSS in your project:

import "@bedrock-layout/css/lib/bedrock-layout.min.css"; // or import "@bedrock-layout/css/lib/components/inline-cluster.min.css";

Optionally, you can install the package for your framework of choice (React.js, Solid.js) using your favorite package manager CLI:

## For React.js yarn add @bedrock-layout/inline-cluster ## or yarn add @bedrock-layout/primitives ## For Solid.js yarn add @bedrock-layout/solid

Then import the component in your project:

// For React.js import { InlineCluster } from '@bedrock-layout/inline-cluster' // or import { InlineCluster } from '@bedrock-layout/primitives' // For Solid.js import { InlineCluster } from '@bedrock-layout/solid'

API

NameDescriptionDefaultControl
gap
string
-
as
unknown
"div"
style
unknown
{}
gutter
-
-
justify
-
-
align
-
-

Gap

The gap prop defines the gap size between elements. Ultimately, the space is controlled by setting the --gap CSS variable.

Default values

Bedrock has implemented a default spacing scheme, but it can be overridden using the ThemeProvider provided by @bedrock-layout/spacing-constants. You can also use any valid CSSLength or positive integer.

Usage examples

// CSS // Using the predefined spacing constants <div data-br-inline-cluster='gap:size3'> <Component /> <Component /> </div> // Or you can use a custom value directly <div data-br-inline-cluster style={{ "--gap": "3ch" }}> <Component /> <Component /> </div> // React.js and Solid.js <InlineCluster gap="size3"> <Component /> <Component /> </InlineCluster> // Or you can use a css value directly <InlineCluster gap="3ch"> <Component /> <Component /> </InlineCluster> // or you can use a custom property <InlineCluster gap="--custom-size-4"> <Component /> <Component /> </InlineCluster>

Here are the possible values for gap by default:

Custom gap as number (20)
Custom gap as string ("3ch")
size000
size00
size1
size2
size3
size4
size5
size6
size7
size8
size9
size10
size11
size12
size13
size14
size15

Justify

The justify prop defines the inline justification of the elements within the cluster. It accepts the following values: start, end, center.

Usage examples

// CSS <div data-br-inline-cluster='justify:end'> <Component /> <Component /> </div> // React.js and Solid.js <InlineCluster justify="end"> <Component /> <Component /> </InlineCluster>
start
end
center
space-around
space-between

Align

The align prop defines the vertical alignment of the elements within the cluster. It accepts the following values: start, end, center, stretch.

Usage examples

// CSS <div data-br-inline-cluster='align:end'> <Component /> <Component /> </div> // React.js and Solid.js <InlineCluster align="end"> <Component /> <Component /> </InlineCluster>
start
end
center
stretch