-
Notifications
You must be signed in to change notification settings - Fork 385
CloudBeaver Styling components
DBeaverDevOps edited this page Jun 19, 2024
·
2 revisions
We use CSS Modules for styling components.
import { useState } from 'react';
import { useS, s } from '@cloudbeaver/core-blocks';
import style from './ExampleComponent.m.css';
function ExampleComponent({ className }) {
const [mode, setMode] = useState('enabled');
const [status, setStatus] = useState(false);
const styles = useS(style);
function handleClick() {
setStatus(!status);
if(status) {
setMode('enabled');
} else {
setMode('disabled');
}
}
return (
<div className={s(styles, { box: true }, className)}>
<h2 className={s(styles, { header: true })}>This is Header</h2>
<p className={s(styles, { message: true, status })}>This is message</p>
<button
className={s(styles, { switch: true })}
data-s-mode={mode}
type="button"
onClick={handleClick}
>
Change status
</button>
<div>
);
}
.box {
border-radius: 3px;
border: solid 1px;
}
.header {
margin: 0;
}
.message {
padding: 8px;
}
.status {
color: red;
}
.switch {
padding: 2px; 4px;
}
.switch[data-s-mode="disabled"] {
opacity: 0.75;
}
- Application overview
- Demo Server
- Administration
- Supported databases
- Accessibility
- Keyboard shortcuts
- Features
- Server configuration
- CloudBeaver and Nginx
- Domain manager
- Configuring HTTPS for Jetty server
- Product configuration parameters
- Command line parameters
- Local Preferences
- Team Edition Overview
- Getting started with Team Edition
- Team Edition Server Configuration
- Projects in Team Edition
- Teams in Team Edition
- Team Edition Deployment
- Roles in Team Edition
- Git integration in Team Edition
- Datasets in Team Edition
-
CloudBeaver Community
-
CloudBeaver AWS
-
CloudBeaver Enterprise
-
Deployment options
-
Development