跳到主要内容

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-否返回事件