文本元素
ui.label、、ui.markdown和ui.restructured_text等元素ui.html可用于显示文本和其他内容。
Text Elements
Label、Link、Chat Message、Generic Element、Markdown Element、ReStructuredText、Mermaid Diagrams、HTML Element
控制
NiceGUI 提供了多种用于用户交互的元素,例如ui.button,,,等等ui.slider。ui.inputs
Button、Button Group、Dropdown Button、Badge、Chip、Toggle、Radio Selection、Dropdown Selection、Checkbox、Switch、Slider、Range、Joystick、Text Input、Textarea、CodeMirror、Number Input、Knob、Color Input、Color Picker、Date Input、Time Input、File Upload
视听元素
您可以使用ui.image、、ui.audio等元素ui.video来显示视听内容。
Image Captions andOverlays Interactive Image Audio Video Icon Avatar SVG
数据元素
有几个用于显示数据的元素,例如ui.table,,,,等等。ui.aggridui.highchartui.echart
Table、AG Grid、Highcharts chart、Apache EChart、Pyplot Context、MatplotlibLine Plot、Plotly Element、Linear Progress、Circular Progress、Spinner、3D Scene、Leaflet map、Tree、 Log View 、 Editor、CodeJSONEditor
绑定属性
要自动更新 UI 元素,您可以将它们相互绑定或绑定到数据模型。
BindingsBind to dictionaryBind to variableBind to storage
页面布局
本节介绍基本技术以及构建 UI 的几个元素。
Auto-context Card Column Element Row Element Grid Element List Clear Containers Teleport Expansion Element Scroll Area Separator Space Skeleton Splitter Tabs Stepper Timeline Carousel Pagination Menu Context Menu TooltipNotification Notification element Dialog
造型与外观
NiceGUI 允许通过多种方式自定义 UI 元素的外观,包括 CSS、Tailwind CSS 和 Quasar 属性。
Styling Try styling NiceGUI elements! Tailwind CSS Tailwind CSS Layers Query Selector Color Theming CSS Variables Overwrite Tailwind's Default Style Dark mode Add CSS style definitions to the page
Action & Events行动与活动
本节介绍计时器、UI 事件和 NiceGUI 应用程序的生命周期。
Timer Keyboard UI Updates Refreshable UI functions Async event handlers Generic EventsRunning CPU-bound tasks Running I/O-bound tasks Run JavaScript Read and write to the clipboard Events Shut down N
Pages & Routing页面和路由
NiceGUI 应用程序可以由多个页面和其他 FastAPI 端点组成。
Page Auto-index page Page Layout Parameter injection Page title Navigation functions ui.open Download Add a directory of static files Add directory of media filesAdd HTML to the pageAPI Responses
Configuration & Deployment配置和部署
无论您想在本地还是在服务器上、本机还是在浏览器中运行您的应用程序,我们都能满足您的需求。
URLsui.runNative ModeEnvironment VariablesServer HostingPackage for InstallationNiceGUI On Air