Skip to content

Notch - Vanilla JS

Terminal window
npm install @fluix-ui/vanilla @fluix-ui/css
import { createNotch } from "@fluix-ui/vanilla";
import "@fluix-ui/css";
const host = document.getElementById("notch-host");
if (host) {
const notch = createNotch(host, {
trigger: "click",
position: "top-center",
theme: "dark",
pill: "+",
content: "Quick actions",
});
// optional imperative controls
notch.open();
notch.close();
notch.toggle();
}
OptionTypeDescription
triggerNotchTriggerOpen behavior
positionNotchPositionScreen anchor
springSpringConfigPhysics config
dotSizenumberCollapsed pill size
roundnessnumberCorner smoothing
themeNotchThemeVisual theme
fillstringBackground fill color
openbooleanControlled open state
onOpenChange(open: boolean) => voidOpen/close callback
pillHTMLElement | stringCollapsed content
contentHTMLElement | stringExpanded content
  • open()
  • close()
  • toggle()
  • update(partialOptions)
  • destroy()