Documentation menu
Getting Started
Components
Primitives
- Agent Thinking
- Alert
- Alert Dialog
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Checkbox
- Command
- Command Palette
- Context Menu
- Data Table
- Dialog
- Dropdown Menu
- Empty
- Field
- Glow Cloud
- Input
- Label
- Medication Schedule
- Period Tabs
- Popover
- Rainbow Button
- Scroll Area
- Select
- Selectable Card
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Tag
- Textarea
- Timeline
- Tooltip
- Use Count Up
Charts and metrics
Patterns
- Confirm Button
- Date Picker
- Embedded
- Empty State
- Entity Drawer
- Error Boundary
- Field Row
- File Dropzone
- Form Dialog
- Kv
- List Editor
- List Page
- Live Time
- Mini Table
- Money
- Note Field
- Note Text
- Page Card
- Page Header
- Page Tabs
- Page Toolbar
- Person Cell
- Picture Field
- Print Card
- Range Switcher
- Row Actions
- Search Input
- Search Select
- Selected Box
- Signature Pad
- Status Badge
- Sub Nav Layout
- Suggest Input
- Tab Icons
- Table Footer
- Theme Accent Picker
- Time Picker
- View All Link
Dashboard cards
Advanced
Device frames
Website widgets
Website screens
Website panels
Patterns
Note Text
Shows clinical notes formatted: headings, bullets and bold.
import { NoteText } from "@/registry/vcare/ui/note-text"
export default function NoteTextDemo() {
return (
<div className="max-w-md">
<NoteText text={"Complaints:\n- Knee pain on stairs\n- Stiff in the morning\n\nPlan:\nPhase 1 programme, **3 sessions a week**."} />
</div>
)
}Installation
npx shadcn@latest add @vcare/note-textOr install directly from the URL: https://ui.vcarehms.com/r/note-text.json
- Copy this file into your project and change the
@/registry/vcare/…imports to your own paths.
components/ui/note-text.tsx
import { memo, type ReactNode } from 'react';
/**
* Turns clinical text into readable formatting: "Heading:" lines become bold headings, "- " lines become bullets and **bold** is
* shown as bold. The stored text is not changed, and stays readable as plain text wherever it is printed.
*/
const inline = (text: string): ReactNode[] =>
text.split(/(\*\*[^*]+\*\*)/g).map((part, i) => (part.startsWith('**') && part.endsWith('**') ? <strong key={i}>{part.slice(2, -2)}</strong> : part));
export const NoteText = memo(function NoteText({ text }: { text: string }) {
const blocks: ReactNode[] = [];
let list: string[] = [];
const flush = () => {
if (list.length) blocks.push(<ul key={blocks.length} className="list-disc space-y-0.5 ps-5">{list.map((l, i) => <li key={i}>{inline(l)}</li>)}</ul>);
list = [];
};
for (const raw of text.replace(/\r/g, '').split('\n')) {
const line = raw.trim();
if (/^[-*•]\s+/.test(line)) { list.push(line.replace(/^[-*•]\s+/, '')); continue; }
flush();
if (!line) continue;
if (/^[A-Z][^:]{0,60}:$/.test(line) || /^#{1,6}\s/.test(line)) blocks.push(<p key={blocks.length} className="mt-2 font-semibold first:mt-0">{line.replace(/^#+\s*/, '').replace(/:$/, '')}</p>);
else blocks.push(<p key={blocks.length}>{inline(line)}</p>);
}
flush();
return <div className="space-y-1.5 text-sm leading-relaxed">{blocks}</div>;
});Usage
import { NoteText } from "@/components/ui/note-text"Exports
NoteText
Dependencies
- None. This component only needs React and Tailwind.
Raw item: /r/note-text.json