logo

SubmitButton

Button used in forms.

Props:

title

Description: Content to display in the button. Type: String. Required.

onClick

Description: Function to invoke on button click. Type: Function. Required.

disabled

Description: Disables the button. Type: Boolean.

loading

Description: Shows loading animation if true. Type: Boolean.

size

Description: Button size. Type: "tiny" | "small" | "medium" | "large". Default: "Medium".

style

Description: Button style. Type: CSS Properties.

className

Description: ClassName. Type: String.

Codeconst [loading, setLoading] = useState(false)
async function signIn() { setLoading(true) const timer = setTimeout(() => { setLoading(false) return () => clearTimeout(timer) }, 1000) }
Code <SubmitButton onClick={signIn} title='Send' disabled={loading} loading={loading} />

PabloSilvaDev - © Copyright 2022