跳到主要内容

NavBar 导航栏

导航栏

import { NavBar, Wrapper } from "@finalx/components";

interface IProps {}
export const Index: FC<IProps> = () => {
return (
<Wrapper>
<NavBar title='导航栏标题' showBack onBack={() => console.log("on back")} />
</Wrapper>
);
};

属性

属性名类型默认值必填描述
titlestring | null | ReactElement-导航栏居中的标题
theme"dark" | "light""dark"导航栏的主题(黑背景白字、白背景黑字)
iconReactElement-图标的组件元素
showBackbooleantrue是否显示返回按钮
scrollShowbooleanfalse滚动的时候是否显示标题
styleCSSProperties-自定义根组件样式
scrollStyleCSSProperties-自定义滚动中的样式

事件

属性名参数必填描述
onBack-返回事件