ืจื›ื™ื‘ื™ืProื—ื“ืฉ

ื˜ื•ืคืก ืžืฉื•ื‘ ืžืชืขืฆื‘

ืกืจื’ืœ ืฆืจ ืขื ื›ืคืชื•ืจ ืžืฉื•ื‘ ืžืชืขืฆื‘ ืœืฉื“ื” ื˜ืงืกื˜. ืฉื•ืœื—ื™ื ื‘-Cmd+Enter, ื•ืื– ื”ืกืจื’ืœ ื ืกื’ืจ ื•ืžื”ื‘ื”ื‘ ื‘ื ืงื•ื“ืช ื”ืฆืœื—ื”.

ื”ืชืืžื”

accentColor
glowColor
highlightColor

ืžื‘ื•ืกืก ืขืœ Morph Surface (MIT ืจื™ืฉื™ื•ืŸ) ยท ืชื ืื™ ืฉื™ืžื•ืฉ

ืžืืคื™ื™ื ื™ื

20 ืžืืคื™ื™ื ื™ื
ืžืืคื™ื™ืŸืกื•ื’ื‘ืจื™ืจืช ืžื—ื“ืœืชื™ืื•ืจ
labelstring"Morph Surface"ื˜ืงืกื˜ ืœื™ื“ ื”ื ืงื•ื“ื” ื‘ืกืจื’ืœ ื”ืžื›ื•ื•ืฅ.
triggerLabelstring"Feedback"ื˜ืงืกื˜ ื”ื›ืคืชื•ืจ ืฉืคื•ืชื— ืืช ื”ื˜ื•ืคืก.
placeholderstring"What's on your mind?"ืจืžื– ื‘ืฉื“ื” ื”ืจื™ืง.
submitLabelstring"โŒ˜ Enter"ืชื•ื•ื™ืช ืงื™ืฆื•ืจ ื”ืฉืœื™ื—ื”.
animationSpeednumber1ืžื›ืคื™ืœ ืžืฉืš: ื’ื‘ื•ื” ื™ื•ืชืจ ืื™ื˜ื™ ื™ื•ืชืจ.
collapsedWidthnumber | 'auto'360ืจื•ื—ื‘ ื”ืกืจื’ืœ ื”ืžื›ื•ื•ืฅ.
collapsedHeightnumber44ื’ื•ื‘ื” ื”ืกืจื’ืœ ื”ืžื›ื•ื•ืฅ.
expandedWidthnumber360ืจื•ื—ื‘ ื”ื˜ื•ืคืก ื”ืคืชื•ื—.
expandedHeightnumber200ื’ื•ื‘ื” ื”ื˜ื•ืคืก ื”ืคืชื•ื—.
triggerIconReactNodeโ€”ืื™ื™ืงื•ืŸ ืœืคื ื™ ื˜ืงืกื˜ ื”ื›ืคืชื•ืจ.
onSubmit(data: FormData) => void | Promise<void>โ€”ืฉืœื™ื—ืช ื”ื˜ื•ืคืก; ื”ื˜ืงืกื˜ ื ืžืฆื ื‘ืฉื“ื” message.
isOpen / onOpenChangeboolean / (open: boolean) => voidโ€”ืฉืœื™ื˜ื” ื‘ืžืฆื‘ ื”ืคืชื™ื—ื” ืžื‘ื—ื•ืฅ.
onOpen / onClose / onSuccess() => voidโ€”ื ืงืจืื™ื ื‘ืคืชื™ื—ื”, ื‘ืกื’ื™ืจื” ื•ื‘ืฉืœื™ื—ื” ืžื•ืฆืœื—ืช.
springConfig{ type: 'spring'; stiffness: number; damping: number; mass?: number }โ€”ืงืคื™ืฅ ืžื•ืชืื ืœื”ืชืขืฆื‘ื•ืช.
renderTrigger / renderContent / renderIndicator(props) => ReactNodeโ€”ื”ื—ืœืคืช ื”ื›ืคืชื•ืจ, ื”ื˜ื•ืคืก ืื• ื”ื ืงื•ื“ื” ื‘ืกื™ืžื•ืŸ ืžืฉืœื›ื.
triggerClassName / contentClassNamestringโ€”ืžื—ืœืงื•ืช ืœื›ืคืชื•ืจ ื•ืœื˜ื•ืคืก.
accentColorstring"#ffffff"ื”ืฆื‘ืข ื”ืจืืฉื™: ื ืงื•ื“ืช ื”ืžื—ื•ื•ืŸ, ืกืžืŸ ื”ื˜ืงืกื˜ ื•ืžืกื’ืจืช ื”ืฉื“ื” ื‘ืคื•ืงื•ืก.
glowColorstring"rgba(255,255,255,0.08)"ื–ื•ื”ืจ ืจืš ืžืชื—ืช ืœืžืฉื˜ื—.
highlightColorstring"rgba(255,255,255,0.25)"ืžืกื’ืจืช ื‘ื”ื™ืจื” ื•ื“ืงื” ืกื‘ื™ื‘ ื”ืžืฉื˜ื—.
classNamestringโ€”ืžื—ืœืงื•ืช ื ื•ืกืคื•ืช.

ืชืœื•ื™ื•ืช

3 ื—ื‘ื™ืœื•ืช ื ื“ืจืฉื•ืช

npm install motion clsx tailwind-merge

ืจื›ื™ื‘ื™ื ื“ื•ืžื™ื

ืœื›ืœ ื”ืจื›ื™ื‘ื™ื