2.0.1 • Published 1 month ago

@sjsf/shadcn-theme v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@sjsf/shadcn-theme

The shadcn-svelte based theme for svelte-jsonschema-form.

Installation

npm install @sjsf/form @sjsf/shadcn-theme

Usage

Setup styles

There is two ways to setup styles:

  1. Use tailwindcss config
import { THEME_CONTENT } from '@sjsf/shadcn-theme/preset'

/** @type {import('tailwindcss').Config} */
export default {
  content: ['./src/**/*.{html,js,svelte,ts}', THEME_CONTENT],
}

Or with a preset

import themePreset from '@sjsf/shadcn-theme/preset'

/** @type {import('tailwindcss').Config} */
export default {
  presets: [themePreset],
}
  1. Inject prepared styles (not recommended)
// Inject them as you like
import themeStyles from "@sjsf/shadcn-theme/styles.css?inline";

Apply theme

<script lang="ts">
  import { createForm } from '@sjsf/form';
  import { theme, setThemeContext } from '@sjsf/shadcn-theme';
  import * as components from '@sjsf/shadcn-theme/default'

  const form = createForm({
    theme,
    ...
  })

  setThemeContext({ components })
</script>

License

MIT

2.0.0-next.15

2 months ago

2.0.0-next.8

3 months ago

2.0.0-next.9

3 months ago

2.0.0-next.6

4 months ago

2.0.0-next.7

4 months ago

2.0.0-next.4

4 months ago

2.0.0-next.5

4 months ago

1.9.1

6 months ago

1.9.0

6 months ago

1.8.0

6 months ago

2.0.0-next.10

3 months ago

1.7.0

8 months ago

1.6.1

8 months ago

2.0.0-next.11

2 months ago

1.6.0

8 months ago

1.5.1

8 months ago

2.0.0-next.12

2 months ago

1.5.0

8 months ago

2.0.0-next.13

2 months ago

1.4.0

9 months ago

2.0.0-next.14

2 months ago

2.0.0-next.2

4 months ago

2.0.0-next.3

4 months ago

2.0.0-next.0

4 months ago

2.0.0-next.1

4 months ago

2.0.1

1 month ago

2.0.0

1 month ago

1.9.2

6 months ago

1.3.0

9 months ago

1.2.0

9 months ago