Skip to contentGet startedTokensComponents@hackclub/theme@hackclub/tokens@hackclub/css-base@hackclub/components@hackclub/meta GitHub
<hc-email-signup id="signup"></hc-email-signup>
<script type="module">
  const signup = document.getElementById('signup')
  signup.addEventListener('hc-submit', async () => {
    signup.status = 'loading'
    await new Promise(resolve => setTimeout(resolve, 800))
    signup.status = 'success'
  })
</script>

API

Attributes

NameTypeDefaultDescription
action, methodstringmethod: "post"Submit natively to this URL (unless hc-submit is canceled)
namestring"email"Field name
placeholderstring"orpheus@hackclub.com"
labelstring"Email address"Accessible label
button-labelstring"Join"
invalid-message, success-messagestringCopy for the error and success states
status"idle" | "loading" | "success""idle"Request state
errorstringShow an error tooltip, e.g. after a failed request

Events

NameDescription
hc-submitCancelable. detail: { email }

CSS parts

NameDescription
form
input
button
error
success
Next: Heading, kicker & gradient text

The design system behind hackclub.com.
Made with <3 by Lamparter.

Get startedTokensComponents@hackclub/theme@hackclub/tokens@hackclub/css-base@hackclub/components@hackclub/metaWebsiteBrand guideIconshackclub/site