ConjureUI
Get StartedDocumentation

Simple Text Input


component.tsx

import { useSimpleTextInputModal } from "@/components/SimpleTextInput";

export default function Page() {
    const _useSimpleTextInput = useSimpleTextInputModal();
    const [userInput, setUserInput] = useState<string>('');

    const openSimpleTextInput = async () =>
    {
        const { action, input } = await _useSimpleTextInput.useTextInput(
                userInput, 'Heading...'
            );

        if (action === 'save' && input !== null)
        {
            setUserInput(input);
        }
    }

    return (
        <button onClick={openSimpleTextInput}>
            Open SimpleTextInput
        </button>
    );
}