@sjsf/shadcn-theme
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

@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 { useForm } from '@sjsf/form';
  import { theme, setThemeContext } from '@sjsf/shadcn-theme';
  import { components } from '@sjsf/shadcn-theme/default'

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

  setThemeContext({ components })
</script>

License

MIT

/@sjsf/shadcn-theme/

    Package Sidebar

    Install

    npm i @sjsf/shadcn-theme

    Weekly Downloads

    139

    Version

    1.6.0

    License

    MIT

    Unpacked Size

    133 kB

    Total Files

    230

    Last publish

    Collaborators

    • x0k