npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aws-amplify/ui-svelte

v1.0.1

Published

Svelte components for Amplify UI

Readme

@aws-amplify/ui-svelte

Svelte components for Amplify UI

Installation

npm install @aws-amplify/ui-svelte aws-amplify

or

yarn add @aws-amplify/ui-svelte aws-amplify

Usage

Basic Usage

<script>
  import { Amplify } from 'aws-amplify';
  import { Authenticator } from '@aws-amplify/ui-svelte';
  import '@aws-amplify/ui/styles.css';
  import awsExports from './aws-exports';

  Amplify.configure(awsExports);
</script>

<Authenticator let:user let:signOut>
  <h1>Hello {user.username}</h1>
  <button on:click={signOut}>Sign out</button>
</Authenticator>

Using with TypeScript

<script lang="ts">
  import { Amplify } from 'aws-amplify';
  import { Authenticator } from '@aws-amplify/ui-svelte';
  import type { AuthUser } from '@aws-amplify/ui-svelte';
  import '@aws-amplify/ui/styles.css';
  import awsExports from './aws-exports';

  Amplify.configure(awsExports);

  let user: AuthUser;
  let signOut: () => void;
</script>

<Authenticator let:user let:signOut>
  <h1>Hello {user.username}</h1>
  <button on:click={signOut}>Sign out</button>
</Authenticator>

Customization

The Authenticator component provides several props for customization:

<Authenticator
  initialRoute="signIn"
  socialProviders={['google', 'facebook', 'amazon']}
  hideSignUp={false}
>
  <!-- Your app content -->
</Authenticator>

Using the useAuthenticator Store

You can also access the authenticator state directly using the store:

<script>
  import { useAuthenticatorStore } from '@aws-amplify/ui-svelte';

  const authenticator = useAuthenticatorStore();

  $: ({ user, authStatus, signOut } = $authenticator);
</script>

{#if authStatus === 'authenticated'}
  <h1>Welcome {user.username}</h1>
  <button on:click={signOut}>Sign out</button>
{:else}
  <p>Please sign in</p>
{/if}

Components

Authenticator

The main component that provides the complete authentication flow.

Props:

  • initialRoute: Initial route to display ('signIn' | 'signUp')
  • socialProviders: Array of social providers to display
  • hideSignUp: Whether to hide the sign up tab

Slot Props:

  • user: The authenticated user object
  • authStatus: Current authentication status
  • signOut: Function to sign out the user

Primitive Components

The package also exports primitive components that can be used to build custom UI:

  • Button
  • TextField
  • PasswordField

Styling

Amplify UI uses CSS variables for theming. You can customize the appearance by overriding these variables:

:root {
  --amplify-colors-brand-primary: #ff6347;
  --amplify-colors-brand-secondary: #ff7f50;
}

SvelteKit Support

When using with SvelteKit, make sure to configure SSR appropriately:

// app.html
<script>
  if (typeof window !== 'undefined') {
    window.global = window;
  }
</script>

TypeScript Support

This package includes TypeScript definitions. No additional setup is required.

License

Apache-2.0