Debian Codegraph @

node/@patternfly/react-core/src/components/LoginPage/examples/LoginPage.md

raw
1 ---
2 id: Login page
3 section: components
4 cssPrefix: pf-v6-c-login
5 propComponents:
6 [
7 'LoginPage',
8 'Login',
9 'LoginForm',
10 'LoginMainBody',
11 'LoginMainHeader',
12 'LoginHeader',
13 'LoginFooter',
14 'LoginMainFooter',
15 'LoginFooterItem',
16 'LoginMainFooterBandItem',
17 'LoginMainFooterLinksItem'
18 ]
19 ---
20
21 import { Fragment, useState } from 'react';
22 import brandImg from '../../assets/PF-IconLogo.svg';
23 import RhUiErrorFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-error-fill-icon';
24 import GoogleIcon from '@patternfly/react-icons/dist/esm/icons/google-icon';
25 import GithubIcon from '@patternfly/react-icons/dist/esm/icons/github-icon';
26 import DropboxIcon from '@patternfly/react-icons/dist/esm/icons/dropbox-icon';
27 import FacebookSquareIcon from '@patternfly/react-icons/dist/esm/icons/facebook-square-icon';
28 import GitlabIcon from '@patternfly/react-icons/dist/esm/icons/gitlab-icon';
29
30 ## Examples
31
32 ### Basic
33
34 By default, a login page requires users to enter both a username and a password into their respective fields. The username must always be a required field, but you can make the password optional by passing the `isPasswordRequired` property to the `<LoginForm>`.
35
36 This example uses `brandImgProps` to pass the brand image source, alt text, and an extra class, which will be preferred over `brandImgSrc` when both are provided.
37 ```ts file='./LoginPageBasic.tsx' isFullscreen
38
39 ```
40
41 ### Show/hide password
42
43 ```ts file='./LoginPageShowHidePassword.tsx' isFullscreen
44
45 ```
46
47 ### Customizing the header utilities
48
49 `headerUtilities` is a prop that can be customized to allow components to be placed into the header of the login page, likely for the user to take an action. The following example demonstrates the use of a Select component to display a list a languages.
50
51 ### With header utilities
52
53 ```ts file='./LoginPageLanguageSelect.tsx' isFullscreen
54
55 ```