Entwicklerportal
CodeGewölbe
Kostenlose Sammlung für Entwickler, Admins und Website-Betreiber: Snippets, VelinStyle-Komponenten, VelinScript-Automationen und Security-Rezepte — copy-paste-fertig.
React Dialog
Was bekomme ich?
HTML
Dünne React-Wrapper (@velinstyle/react) über dieselben WCs.
Fortgeschritten
5 Min.
Code
import { useRef } from 'react';
import { VelinDialog, VelinThemeToggle } from '@velinstyle/react';
import '@birdapi/velinstyle/css';
import '@birdapi/velinstyle/bundle';
export function App() {
const dialogRef = useRef(null);
return (
<>
<VelinThemeToggle target="html" />
<VelinDialog ref={dialogRef} />
<button
type="button"
className="velin-btn velin-btn--primary"
onClick={() => dialogRef.current?.confirm('Weiter?', { title: 'Einstellungen' })}
>
Dialog öffnen
</button>
</>
);
}
npm install @birdapi/velinstyle @velinstyle/react react