From 82e5a076f50db8cc998fadb93c7c1a29403e8b48 Mon Sep 17 00:00:00 2001 From: tphung Date: Fri, 22 Aug 2025 22:29:16 +0700 Subject: [PATCH 1/5] chore: update readme for image showcase and better theming alternative --- packages/shadcn/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/shadcn/README.md b/packages/shadcn/README.md index 2b789140ef..c6233126e1 100644 --- a/packages/shadcn/README.md +++ b/packages/shadcn/README.md @@ -20,6 +20,11 @@ Request Feature

+ +

+Logo +

+ ## Table of Contents @@ -134,8 +139,7 @@ Supported colors are: #### Coloring - Generate a theme from [official shadCN site](https://ui.shadcn.com/themes) - or [zippy starter's shadcn/ui theme generator](https://zippystarter.com/tools/shadcn-ui-theme-generator) - or [Railly](https://customizer.railly.dev/) + or [tweakcn](https://tweakcn.com/editor/theme) - Navigate to shadcn/css, create a new file called [your-theme].css - Replace the base layer code with your new color - Follow the next section to build your CSS file From 039c76ce9dad36da8d83cf49ba8e10126fb76bd4 Mon Sep 17 00:00:00 2001 From: tphung Date: Fri, 22 Aug 2025 22:51:02 +0700 Subject: [PATCH 2/5] feat: allow className props to be passed for custom tailwind class styling on widget --- packages/shadcn/src/AddButton/AddButton.tsx | 7 ++++++- .../src/BaseInputTemplate/BaseInputTemplate.tsx | 3 ++- .../shadcn/src/CheckboxWidget/CheckboxWidget.tsx | 2 ++ .../src/CheckboxesWidget/CheckboxesWidget.tsx | 15 ++++++++++++++- packages/shadcn/src/RadioWidget/RadioWidget.tsx | 3 ++- packages/shadcn/src/SelectWidget/SelectWidget.tsx | 7 +++++-- packages/shadcn/src/SubmitButton/SubmitButton.tsx | 3 ++- .../shadcn/src/TextareaWidget/TextareaWidget.tsx | 2 ++ 8 files changed, 35 insertions(+), 7 deletions(-) diff --git a/packages/shadcn/src/AddButton/AddButton.tsx b/packages/shadcn/src/AddButton/AddButton.tsx index 6130db998f..5f9a3cfea1 100644 --- a/packages/shadcn/src/AddButton/AddButton.tsx +++ b/packages/shadcn/src/AddButton/AddButton.tsx @@ -2,20 +2,25 @@ import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, Transla import { PlusCircle } from 'lucide-react'; import { Button } from '../components/ui/button'; +import { cn } from '../lib/utils'; /** * A button component for adding new items in a form + * @param uiSchema - The UI schema for the form, which can include custom properties + * @param registry - The registry object containing the form's configuration and utilities + * @param className - Allow custom class names to be passed for Tailwind CSS styling * @param props - The component properties */ export default function AddButton({ uiSchema, registry, + className, ...props }: IconButtonProps) { const { translateString } = registry; return (
-
diff --git a/packages/shadcn/src/BaseInputTemplate/BaseInputTemplate.tsx b/packages/shadcn/src/BaseInputTemplate/BaseInputTemplate.tsx index e37ff32132..77893c6aec 100644 --- a/packages/shadcn/src/BaseInputTemplate/BaseInputTemplate.tsx +++ b/packages/shadcn/src/BaseInputTemplate/BaseInputTemplate.tsx @@ -40,6 +40,7 @@ export default function BaseInputTemplate< rawErrors = [], children, extraProps, + className, }: BaseInputTemplateProps) { const inputProps = { ...extraProps, @@ -61,7 +62,7 @@ export default function BaseInputTemplate< required={required} disabled={disabled} readOnly={readonly} - className={cn({ 'border-destructive focus-visible:ring-0': rawErrors.length > 0 })} + className={cn({ 'border-destructive focus-visible:ring-0': rawErrors.length > 0 }, className)} list={schema.examples ? examplesId(id) : undefined} {...inputProps} value={value || value === 0 ? value : ''} diff --git a/packages/shadcn/src/CheckboxWidget/CheckboxWidget.tsx b/packages/shadcn/src/CheckboxWidget/CheckboxWidget.tsx index b1588c3f60..559f8a7c92 100644 --- a/packages/shadcn/src/CheckboxWidget/CheckboxWidget.tsx +++ b/packages/shadcn/src/CheckboxWidget/CheckboxWidget.tsx @@ -37,6 +37,7 @@ export default function CheckboxWidget< onFocus, registry, uiSchema, + className, } = props; // Because an unchecked checkbox will cause html5 validation to fail, only add // the "required" attribute if the field value must be "true", due to the @@ -78,6 +79,7 @@ export default function CheckboxWidget< onCheckedChange={_onChange} onBlur={_onBlur} onFocus={_onFocus} + className={className} />