Navigation and layout

Grid and list

ViewStateIcon

Switches a collection between grid and list layouts.

States

2 total

Show as list

The collection uses a grid layout.

Show as list

"grid"

The collection uses a grid layout.

Show as grid

"list"

The collection uses a list layout.

Implementation

Pass your current state.

The component stays presentational. Your application remains in control of async work and business logic. The state prop is a TypeScript string literal union — pass an invalid state and you'll get a type error at build time.

Source
Lucide
License
ISC
States
grid · list
example.tsx
import { ViewStateIcon } from "@stateglyph/react";
<ViewStateIcon state="grid" decorative />