Please give a brief summary of your issue:
(Think of this as an email subject)
I need to add a class name to the statefulButton and style it using stylesheet.
I use NextJS
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
I add a custom button to the header as below
instance.UI.setHeaderItems(header => {
header
.getHeader(‘default’)
.get(‘panToolButton’)
.insertAfter({
type: ‘statefulButton’,
initialState: ‘Show’,
states: {
Show: {
// img: ‘icon-header-annotation’,
getContent: () => ‘Add Note’,
onClick: (update: (arg0: string) => void) => {
update(‘Hide’);
enableFeatures([Feature.Annotations]);
},
},
Hide: {
getContent: () => ‘Hide Note’,
onClick: (update: (arg: string) => void) => {
update(‘Show’);
disableFeatures([Feature.Annotations]);
},
},
},
dataElement: ‘showAnnotationButton’,
});
});
I would like to add class name to this button and access it from stylesheet and add required css.
Is it possible? If possible please give me an example.
Along with this can we get the header icons name which we can use with custom buttons
for eg: ‘icon-header-download’, similar to this. Where we can find the list of default icons.
Please provide a link to a minimal sample where the issue is reproducible:
img and getContent are used to create a button with icon and text. img can be a path to an image or base64 data or the filename of a .svg from the WebViewer assets/icons/ folder
For styling them, you’ll need to add your custom CSS stylesheet, see link again Apryse Documentation | Documentation. You might want to adjust button’s width: auto to have both icon and text visible.
From the above code:
For that custom toggle button, you can follow instructions here Apryse Documentation | Documentation and modify the code to your liking to create that custom button.
I was trying custom Element and pushed a custom search box in the header. But having difficulty in styling it. How can I add the class and style it. see the custom element JSX
import styles from ‘./SearchInput.module.scss’;
const SearchInput = ({ onChange, onSubmit }) => (
{
onChange(event);
}}
/>
onSubmit()}>
Search
);
export default SearchInput;
I use a custom stylesheet as imported above(/SearchInput.module.scss). But when I add a class to div it is not showing in browser DOM when I inspect.