supabase-community / auth-ui

Pre-built Auth UI for React
https://supabase.com/docs/guides/auth/auth-helpers/auth-ui
MIT License
488 stars 121 forks source link

feat: export UI components #253

Open shfshanyue opened 8 months ago

shfshanyue commented 8 months ago

What kind of change does this PR introduce?

export UI components such as Input Label, etc. In order to extend and adopt the same style as the <Auth /> component.

for example:add the username attribute to <EmailAuth> component when viewType = signup

const [ name, setName ] = useState('')

<Auth
  supabaseClient={supabase}
  additionalData={{
    name
  }}
>
  <div>
    <Label htmlFor="username" appearance={appearance}>
      {labels?.password_label}
    </Label>
    <Input
      id="username"
      type="text"
      name="username"
      onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
        setName(e.target.value)
      }
      appearance={appearance}
    />
  </div>
</Auth>

What is the current behavior?

Please link any relevant issues here.

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Add any other context or screenshots.