When building UI, follow the project’s existing design-system components and tokens instead of creating bespoke patterns.
Standards
RAGFlowFormItem, SimilaritySliderFormField, and SearchInput rather than re-implementing the same UI logic/styling.Table component (not a hand-rolled <table> with custom class logic).Dialog implementation (multi-field forms, footers, local state), move it to a dedicated file/component.tailwind.css over ad-hoc inline style= so theming stays consistent.Example (extraction + token usage)
// skills/components/CreateSpaceDialog.tsx
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
export function CreateSpaceDialog(props: {
open: boolean;
onOpenChange: (v: boolean) => void;
value: string;
onChange: (v: string) => void;
onCreate: () => void;
onCancel: () => void;
}) {
return (
<Dialog open={props.open} onOpenChange={props.onOpenChange}>
<DialogContent className="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Create New Skill Space</DialogTitle>
<DialogDescription>Organize and manage your skills.</DialogDescription>
</DialogHeader>
<div className="py-4">
<label className="text-sm font-medium mb-2 block">Space Name</label>
<Input value={props.value} onChange={(e) => props.onChange(e.target.value)} />
</div>
<DialogFooter>
<Button variant="outline" onClick={props.onCancel}>Cancel</Button>
<Button onClick={props.onCreate} disabled={!props.value.trim()}>Create</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
}
Applying these keeps UI consistent, reduces duplicated styling/behavior, improves readability, and makes future theme/UI updates cheaper.
Enter the URL of a public GitHub repository