3.3.43 • Published 28 days ago

@boxyhq/svelte-ui v3.3.43

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
28 days ago

@boxyhq/svelte-ui

UI components from BoxyHQ for plug-and-play enterprise features.

Installation

npm install @boxyhq/svelte-ui --save

Usage

SSO Login Component

There are mainly 2 ways of using the SSO Login Component as outlined below:

Preset value for ssoIdentifier

If a value is passed for ssoIdentifier, it would render a button that on click calls the passed-in handler (onSubmit) with the ssoIdentifier value. The handler can then initiate a redirect to the SSO service forwarding the value for ssoIdentifier.

<script>
	import { Login } from '@boxyhq/svelte-ui/sso';

	const onSSOSubmit = async ({ ssoIdentifier }) => {
		// initiate the SSO flow here
		console.log(ssoIdentifier);
	};
</script>

<Login
	buttonText={'Login with SSO'}
	ssoIdentifier={`tenant=${tenant}&product=${product}`}
	onSubmit={onSSOSubmit}
	classNames={{
		container: 'mt-2',
		button: 'btn-primary btn-block btn rounded-md active:-scale-95'
	}}
/>;

Accept input from the user for ssoIdentifier

If a value is not passed for ssoIdentifier, it would render an input field for the user to enter the ssoIdentifier value. And then on submit, the value gets passed to the handler. The handler can then initiate a redirect to the SSO service forwarding the value for ssoIdentifier.

<script>
	import { Login } from '@boxyhq/svelte-ui/sso';

	const onSSOSubmit = async ({ ssoIdentifier }) => {
		// initiate the SSO flow here
		console.log(ssoIdentifier);
	};
</script>

<Login
	buttonText={'Login with SSO'}
	onSubmit={onSSOSubmit}
	classNames={{
		container: 'mt-2',
		label: 'text-gray-400',
		button: 'btn-primary btn-block btn rounded-md active:-scale-95',
		input: 'input-bordered input mb-5 mt-2 w-full rounded-md'
	}}
/>;

Styling

If the classNames prop is passed in, we can override the default styling for each inner element. In case an inner element is omitted from the classNames prop, default styles will be set for the element. NOTE: At the moment sourcing the CSS class names using component level<style> won't work due to scoping. You can keep the class names in a global stylesheet.

Styling via styles attribute is also supported for each inner element.

<Login
	buttonText={'Login with SSO'}
	onSubmit={onSSOSubmit}
	classNames={{
		container: 'mt-2',
		label: 'text-gray-400',
		button: 'btn-primary btn-block btn rounded-md active:-scale-95',
		input: 'input-bordered input mb-5 mt-2 w-full rounded-md'
	}}
/>
3.3.43

28 days ago

3.3.42

2 months ago

3.3.41

2 months ago

3.3.40

2 months ago

3.3.39

2 months ago

3.3.38

3 months ago

3.3.37

3 months ago

3.3.36

3 months ago

3.3.35

3 months ago

3.3.34

3 months ago

3.3.33

4 months ago

3.3.32

4 months ago

3.3.30

4 months ago

3.3.31

4 months ago

3.3.29

4 months ago

3.3.28

4 months ago

3.3.26

4 months ago

3.3.27

4 months ago

3.3.24

5 months ago

3.3.25

5 months ago

3.3.23

5 months ago

3.3.22

6 months ago

3.3.20

6 months ago

3.3.21

6 months ago

3.3.13

7 months ago

3.3.14

7 months ago

3.3.15

7 months ago

3.3.16

7 months ago

3.3.17

6 months ago

3.3.18

6 months ago

3.3.19

6 months ago

3.3.10

9 months ago

3.3.11

8 months ago

3.3.12

8 months ago

3.3.9

9 months ago

3.3.8

9 months ago

3.3.7

9 months ago

3.3.6

9 months ago

3.2.2

10 months ago

3.2.1

10 months ago

3.2.0

10 months ago

3.1.1

10 months ago

3.1.0

10 months ago

3.3.5

10 months ago

3.3.4

10 months ago

3.3.3

10 months ago

3.2.3

10 months ago

3.0.0

11 months ago