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

2.1.1 • 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 { 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

Package Sidebar

Install

npm i @sjsf/shadcn-theme

Weekly Downloads

67

Version

2.1.1

License

MIT

Unpacked Size

233 kB

Total Files

368

Last publish

Collaborators

  • x0k