Praise be to Allah.
Ruling on writing stories
Writing books and stories is something that is permissible in principle.
On our website, we have previously discussed the scholarly views on the ruling on writing fiction stories, in question no. 174829, where we stated that the correct view that it is permissible, if the story is aimed at promoting good values and righteousness.
But it is not possible to apply the same ruling to all books, because there are some books which are useful and there are some books which are harmful to the morals, religious commitment and beliefs of the reader.
So based on that, what you are going to write cannot all be regarded as being of the same nature; rather you have to examine each book that you want to write, and each idea that you want to discuss, and try hard to make sure there is no element of falsehood in it, because we are instructed to avoid falsehood, as Allah, may He be exalted) says (interpretation of the meaning): “and avoid false statements” [al-Hajj 22:30].
Shaykh Muhammad al-Ameen ash-Shinqeeti (may Allah have mercy on him) said:
In this verse, Allah instructs us to avoid false statements, which means lies and falsehood…
End quote from Adwa’ al-Bayaan (5/750).
Guidelines on writing stories and novels
It is not permissible to write that which propagates false beliefs or that promotes corruption of morals and promiscuity.
If you are keen to write that which is permissible or that which promotes good values, then with regard to what those in charge of the project will add of explanatory illustrations, no bearer of burdens will bear the burden of another, and the sin of that will be on them, so long as you do not approve of it or contribute to it. However, you stated that these books are for children, and as that is the case, Islamic teaching grants a concession regarding drawings and pictures if they are for children.
See the answer to question no. 315944.
Conclusion: there is nothing wrong with this work of yours, so long as what you write is free of corrupt ideas that could affect people’s morals, and the permissibility becomes clearer if what you are writing is not only for a permissible type of entertainment (see question no. 325802), but rather it is used for good aims and to promote good values, such as promoting sound beliefs and good manners among the new generation.
And Allah knows best.