login.create()
Creates a student ID-based login interface with barcode scanning support.Signature
Parameters
Callback function triggered when the user submits their student ID (via Enter key or Sign In button).The function should validate the ID and handle successful authentication.
Returns
The root container element with class
login-outer scsu-bg. Contains the entire login UI with left branding panel and right input panel.The student ID input field. Has autofocus enabled and is bound to the
on_login_success callback on Enter key press.Access the value with id_input.value.UI Structure
The component creates a split-screen layout: Left Panel (42% width)- SCSU logo (inverted/white)
- Blue accent divider with glow effect
- “Department of Computer Science” label
- “CS Library Sign-in Portal” heading
- Descriptive text
- Copyright footer
- Diagonal stripe texture overlay
- “Welcome Back” heading (3rem, bold)
- Blue accent bar with shadow
- Instructions: “Scan your ID to enter CS Library Kiosk”
- Student ID input field with badge icon
- “Sign In” button with blue glow on hover
- Live clock display (updates every second)
Styling Features
- Dark theme with
#0a1f44blue background on left panel - Starfield background via
scsu-bgclass - Input field uses NiceGUI’s
dark standoutprops - Blue (
#3b82f6) accent color with glow effects - Responsive with Space Grotesk font family
Usage Example
login_email.create()
Creates an email/password authentication interface with registration link.Signature
Parameters
Callback function triggered when the user submits credentials (via Enter key on password field or Sign In button).The function should validate email/password and handle successful authentication.
Returns
The root container element with class
login-outer scsu-bg. Contains the entire login UI.The email input field. Has autofocus enabled and includes a special
password_input attribute for accessing the password field.Special Property:email_input.password_input: Reference to the password input field
UI Structure
Similar split-screen layout tologin.create() with key differences:
Left Panel
- Same branding as student ID login
- “Welcome Back” heading
- Blue accent bar
- Instructions: “Sign in with your email and password”
- Email input field with email icon
- Password input field with lock icon
- “Sign In” button
- Registration link: “Don’t have an account? Create one”
- Live clock display
Interactive Features
- Enter key on email: Focuses password field
- Enter key on password: Triggers
on_login_success - Registration link: Navigates to
/registerroute - Password field has
type=passwordfor masked input
Usage Example
Common Patterns
Switching Between Kiosk and Web Modes
Styling Customization
Both components inject custom CSS viaui.add_head_html() with these classes:
.login-outer: Full viewport flex container.left-panel: 42% width branding panel with#0a1f44background.right-panel: Flexible right panel for inputs.stripe-texture: Diagonal stripe overlay pattern.scsu-bg: Starfield background (defined globally)
Time Display Pattern
Both components include a live clock using NiceGUI timers:See Also
- Dashboard Component - Main application interface after login
- Register Component - Account creation interface
- Database Module - User authentication functions