shadimage
mksingh
componentjsonforms-boolean-toggle-cellsource: ok · hit

Jsonforms Boolean Toggle Cell

JSONForms switch cell for boolean fields inside array table layouts.

npx shadcn add "https://mksingh.dev/r/jsonforms-boolean-toggle-cell.json"
free

Where it goes

data-table

Use cases

dashboard

Tags auto-generated by rules on 9/24/2026 — empty means no evidence, not lack of support.

Dependencies

Bundle weight · light
@jsonforms/core@jsonforms/react

Registry dependencies

switch

Files1 · source cached 10/8/2026, 2:58:01 PM

registry/forms/renderers/cells/boolean-toggle-cell.tsx
import { and, CellProps, isBooleanControl, optionIs, rankWith } from '@jsonforms/core';
import { withJsonFormsCellProps } from '@jsonforms/react';

import { Switch } from '~/components/ui/switch';

const BooleanToggleCell = ({ data, handleChange, path, enabled }: CellProps) => (
    <Switch
        checked={data ?? false}
        onCheckedChange={checked => handleChange(path, checked)}
        disabled={!enabled}
    />
);

export const booleanToggleCellTester = rankWith(2, and(isBooleanControl, optionIs('toggle', true)));
export default withJsonFormsCellProps(BooleanToggleCell);

More from mksingh

Browse all components in this library →