I am using Notification ponent from ant design and I want to remove close (X) button from Notification box.
I've tried adding closable: false
and icon: null
but not working
notification.info({
description: "Sample description",
closable: false,
icon: null
})
I am using Notification ponent from ant design and I want to remove close (X) button from Notification box.
I've tried adding closable: false
and icon: null
but not working
notification.info({
description: "Sample description",
closable: false,
icon: null
})
Share
Improve this question
edited Jul 17, 2019 at 12:30
Dennis Vash
54k12 gold badges117 silver badges132 bronze badges
asked Jul 17, 2019 at 11:28
sakethsaketh
331 silver badge5 bronze badges
3 Answers
Reset to default 6if you are using Ant Design >= 3.x notification have a property call closeIcon which accepts ReactNode you can use closeIcon : (<div></div>)
to hide the close icon. check the doc here Notification Component
Happy Coding...
Ant Design Notification doesn't accept closable
prop. Please read the documentation.
I use Angular with ng-zorro. In the documentation there is this part. nzCloseIcon --> Custom close icon --> TemplateRef | string
I use a TemplateRef to do it.
html:
`<ng-template #none></ng-template>`
ts:
@ViewChild("none", { static: false }) none?: TemplateRef<{}>;
this.nzNotification.template(
this.template!, { nzCloseIcon: this.none }
);